package cn.com.aiouyi.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotEmpty;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name="t_article_class")
public class ArticleClass extends SeqEntity<Long>{
	
	private static final long serialVersionUID = 1L;

	/** @Fields 文章类别名称*/
	@NotEmpty
	private String name;
	
	/** @Fields 文章分类显示的序号，序号越小显示越上面，负数则不显示*/
	private Integer sequence;

	/** @Fields 文章分类显示的序号，序号越小显示越上面，负数则不显示*/
	@Column(columnDefinition="int default 0")
	private Integer indexSequence;
	/** @Fields 所属的文章主题*/
//	@ManyToOne
//	private ArticleTheme articleTheme;
	
	/** @Fields 这个类别下的文章*/
	@ManyToMany(mappedBy="articleClasses")
	private List<Article> articles = new ArrayList<>();
}
